<?php
$this->breadcrumbs=array(
	'Regions'=>array('index'),
	'Create',
);

$this->menu=array(
	array('label'=>'List Region', 'url'=>array('index')),
	array('label'=>'Manage Region', 'url'=>array('admin')),
);
?>

<h1>Create Region</h1>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm'); ?>

<?php

	echo CHtml::dropDownList('province_id','', Region::model()->getProvinceOpinions(),
	array(
	'ajax' => array(
	'type'=>'POST', //request type
	'url'=>Yii::app()->createUrl('region/dynamicCities'),
	'update'=>'#city_id', //selector to update
	//'data'=>'js:javascript statement' 
	//leave out the data key to pass all form values through
	))); 
	//empty since it will be filled by the other dropdown
	echo CHtml::dropDownList('city_id','', Region::model()->getCityOpinions(2),
	array(
	'ajax' => array(
	'type'=>'POST', //request type
	'url'=>Yii::app()->createUrl('region/dynamicAreas'),
	'update'=>'#area_id', //selector to update
	//'data'=>'js:javascript statement' 
	//leave out the data key to pass all form values through
	))); 
	//empty since it will be filled by the other dropdown
	echo CHtml::dropDownList('area_id','', Region::model()->getCityOpinions(52));

?>

<?php $this->endWidget(); ?>

</div><!-- form -->